<?php
class Application_Model_ConnectDB 
{	
	public function dbConnect()	
	{
		$db = Zend_Db::factory('Pdo_Mysql', array ('host' => 'localhost',
                           			 'username' => 'root',
                           			 'password' => '',
                            		 'dbname' => 'zendframework'));		
		$db->query("SET NAMES `utf8`"); 				
		return $db;
	}
	
	
	public function dbTable($sql)	
	{
		$this->dbConnect()->setFetchMode(Zend_Db::FETCH_OBJ);								
		return $this->dbConnect()->fetchAll($sql);
	}	
}
